package com.iye.puretennis.custom;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import cn.jpush.android.api.JPushInterface;
import com.iye.puretennis.activity.MainTabsActivity;

/**
 * Created with IntelliJ IDEA.
 * User: jing wu
 * Date: 2014/12/25
 * Time: 16:10
 */
public class PushMessageReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if(JPushInterface.ACTION_NOTIFICATION_OPENED.equals(intent.getAction())){

            Bundle bundle = intent.getExtras();

            Intent mIntent = new Intent(context, MainTabsActivity.class);

            mIntent.putExtras(bundle);

            mIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

            context.startActivity(mIntent);

        }
    }
}
